package game;

import utils.RandomUtils;

public class Cloud extends Sprite{
    GameManager game = GameManager.getInstance();
    @Override
    public void init() {
        this.x = 600;
        super.y = RandomUtils.randomInt(0,75);
        super.image = ImageManager.loadImage("src/Images/"+ GameData.Skin +"/cloud.png");
        super.width = super.image.getWidth();
        super.height = super.image.getHeight();
        this.speed = 3;
    }

    @Override
    public void move() {
        super.x = super.x -super.speed;
        if(x<-40){
            this.destroy();
        }
    }

    @Override
    public void destroy() {
        game.cloudList.remove(this);
    }
}
